#if !defined(ximera_input_imouse_hpp)
#define ximera_input_imouse_hpp

// -----------------------------------------------------------

#include <ximera/input/idevice.hpp>
#include <ximera/common/signal.hpp>
#include <ximera/input/codes.hpp>

namespace ximera { namespace input
{
    //! \brief Exception for Keyboard errors
    XIMERA_DECLARE_EXCEPTION_SUB(MouseException, DeviceException, L"Mouse error");

    //! Interface that represents a Keyboard input device
    class XIMERA_API IMouse: public IDevice
    {
    public:
        /*! Defines the prototype of the event that will be called when a button is pressed on the mouse device.
         *  \param sender It's the device where the button was pressed.
         *  \param mouseCode It's the button that was pressed. */
        typedef void (OnMouseDownEvent)(IMouse* sender, MouseCode const& mouseCode);

        /*! Defines the prototype of the event that will be called when a button is released on the mouse device.
         *  \param sender It's the device where the button was released.
         *  \param mouseCode It's the button that was released. */
        typedef void (OnMouseUpEvent)(IMouse* sender, MouseCode const& mouseCode);

        virtual ~IMouse();

        /*! \brief Returns if the mouse button is pressed.
         *
         *  Returns true if the mouse button is pressed, otherwise returns false.
         *  \param mouseCode Is the code of the mouse button that is wanted 
         */
        virtual bool isMousePressed(MouseCode const& mouseCode) = 0;

        /*! Event that rises when a button is pressed to the mouse. */
        Signal<OnMouseDownEvent>& onMouseDown();

        /*! Event that rises when a button is released to the mouse. */
        Signal<OnMouseUpEvent>& onMouseUp();

    protected:

        Signal<OnMouseDownEvent> _onMouseDown;
        Signal<OnMouseUpEvent> _onMouseUp;
    };
}}

// -----------------------------------------------------------

#endif
